package com.example.settlement.service;

import com.example.settlement.entity.Settlement;
import com.example.settlement.mapper.SettlementMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SettlementService {

    @Autowired
    private SettlementMapper settlementMapper;

    public void addSettlement(Settlement settlement) {
        settlementMapper.insert(settlement);
    }

    public List<Settlement> getSettlementsByUserId(Long userId) {
        return settlementMapper.findByUserId(userId);
    }
}
